home *** CD-ROM | disk | FTP | other *** search
/ Aminet 35 / Aminet 35 (2000)(Schatztruhe)[!][Feb 2000].iso / Aminet / dev / src / stefanb_src.lha / UMS / Developer / c / include / libraries / umsrfc.h < prev   
Encoding:
C/C++ Source or Header  |  1997-06-08  |  5.7 KB  |  175 lines

  1. #ifndef LIBRARIES_UMSRFC_H
  2. #define LIBRARIES_UMSRFC_H
  3.  
  4. /*
  5.  * libraries/umsrfc.h
  6.  *
  7.  * C definitions for umsrfc.library
  8.  *
  9.  * $VER: umsrfc.h 1.2 (08.06.97)
  10.  *
  11.  * (C) 1994-1997 by Stefan Becker
  12.  *
  13.  */
  14.  
  15. #ifndef UTILITY_TAGITEM_H
  16. #include <utility/tagitem.h>
  17. #endif
  18.  
  19. #ifndef LIBRARIES_UMS_H
  20. #include <libraries/ums.h>
  21. #endif
  22.  
  23. /* Library version */
  24. #define UMSRFC_LIBRARY_NAME    "umsrfc.library"
  25. #define UMSRFC_LIBRARY_VERSION 1
  26.  
  27. /*
  28.  * struct UMSRFCBases
  29.  *
  30.  * This structure contains pointers to library bases. These libraries are
  31.  * needed by the functions of umsrfc.library. This data structure will be
  32.  * used by umsrfc.library/AllocUMSRFCData().
  33.  */
  34. struct UMSRFCBases {
  35.  const struct Library *urb_UMSBase;     /* Pointer to "ums.library" base     */
  36.  const struct Library *urb_DOSBase;     /* Pointer to "dos.library" base     */
  37.  const struct Library *urb_UtilityBase; /* Pointer to "utility.library" base */
  38. };
  39.  
  40. /*
  41.  * struct UMSRFCMsgData
  42.  *
  43.  * This data structure contains additional information about an UMS message.
  44.  * It will be filled automatically by calling umsrfc.library/GetUMSMessage().
  45.  *
  46.  * ALL ENTRIES ARE READ ONLY!!!
  47.  */
  48. struct UMSRFCMsgData {
  49.  UMSMsgNum  urmd_MsgNum;;   /* Msg number of current msg   READ ONLY!!! */
  50.  UMSMsgNum  urmd_ChainUp;   /* Msg number of parent msg    READ ONLY!!! */
  51.  UMSMsgNum  urmd_HardLink;  /* Msg is hard-linked to...    READ ONLY!!! */
  52.  UMSMsgNum  urmd_SoftLink;  /* Msg is soft-linked to...    READ ONLY!!! */
  53.  ULONG      urmd_MsgDate;   /* Receive date (Amiga epoch)  READ ONLY!!! */
  54.  ULONG      urmd_MsgCDate;  /* Creation date (Amiga epoch) READ ONLY!!! */
  55.  ULONG      urmd_HeaderLen; /* Header length               READ ONLY!!! */
  56.  ULONG      urmd_TextLen;   /* Text length                 READ ONLY!!! */
  57. };
  58.  
  59. /*
  60.  * Global flags
  61.  */
  62. #define UMSRFC_FLAGS_NOOWNFQDN   0x01 /* System has no own domain name      */
  63.                                       /* READ ONLY!!!                       */
  64. #define UMSRFC_FLAGS_8BITALLOWED 0x02 /* Receiver allows 8bit encoding      */
  65.                                       /* READ & WRITE, set by default       */
  66. #define UMSRFC_FLAGS_MSGIS8BIT   0x04 /* Message created with 8bit encoding */
  67.                                       /* READ ONLY!!!                       */
  68.  
  69. /*
  70.  * Common tag items
  71.  */
  72. #define UMSRFC_TAGS_SUBJECT     0 /* UMSTAG_WSubject      */
  73. #define UMSRFC_TAGS_FROMNAME    1 /* UMSTAG_WFromName     */
  74. #define UMSRFC_TAGS_FROMADDR    2 /* UMSTAG_WFromAddr     */
  75. #define UMSRFC_TAGS_REPLYNAME   3 /* UMSTAG_WReplyName    */
  76. #define UMSRFC_TAGS_REPLYADDR   4 /* UMSTAG_WReplyAddr    */
  77. #define UMSRFC_TAGS_DATE        5 /* UMSTAG_WCreationDate */
  78. #define UMSRFC_TAGS_CDATE       6 /* UMSTAG_WMsgCDate     */
  79. #define UMSRFC_TAGS_MSGID       7 /* UMSTAG_WMsgID        */
  80. #define UMSRFC_TAGS_REFERID     8 /* UMSTAG_WReferID      */
  81. #define UMSRFC_TAGS_ORG         9 /* UMSTAG_WOrganization */
  82. #define UMSRFC_TAGS_MSGREADER  10 /* UMSTAG_WNewsReader   */
  83. #define UMSRFC_TAGS_MSGTEXT    11 /* UMSTAG_WMsgText      */
  84. #define UMSRFC_TAGS_ATTRIBUTES 12 /* UMSTAG_WAttributes   */
  85. #define UMSRFC_TAGS_COMMENTS   13 /* UMSTAG_WComments     */
  86.  
  87. /*
  88.  * Mail tag items
  89.  */
  90. #define UMSRFC_TAGS_SOFTLINK   14 /* UMSTAG_WSoftLink     */
  91. #define UMSRFC_TAGS_TONAME     15 /* UMSTAG_WToName       */
  92. #define UMSRFC_TAGS_TOADDR     16 /* UMSTAG_WToAddr       */
  93.  
  94. /*
  95.  * News tag items
  96.  */
  97. #define UMSRFC_TAGS_HARDLINK   14 /* UMSTAG_WHardLink     */
  98. #define UMSRFC_TAGS_GROUP      15 /* UMSTAG_WGroup        */
  99. #define UMSRFC_TAGS_REPLYGROUP 16 /* UMSTAG_WReplyGroup   */
  100. #define UMSRFC_TAGS_DIST       17 /* UMSTAG_WDistribution */
  101. #define UMSRFC_TAGS_HIDE       18 /* UMSTAG_WHide         */
  102.  
  103. /*
  104.  * Number of tag items in the message tag arrays
  105.  */
  106. #define UMSRFC_MAILTAGS 18
  107. #define UMSRFC_NEWSTAGS 20
  108.  
  109. /*
  110.  * Length of RFC address buffers
  111.  */
  112. #define UMSRFC_ADDRLEN 200
  113.  
  114. /*
  115.  * Length of RFC time/date buffers
  116.  */
  117. #define UMSRFC_TIMELEN 32
  118.  
  119. /*
  120.  * struct UMSRFCData
  121.  *
  122.  * This data structure is needed by all functions of the umsrfc.library.
  123.  * It will be allocated by calling umsrfc.library/AllocUMSRFCData(). It
  124.  * can be freed by calling umsrfc.library/FreeUMSRFCData().
  125.  *
  126.  * MOST OF THE FIELDS ARE READ ONLY!
  127.  */
  128. struct UMSRFCData {
  129.  /*
  130.   * These fields will be filled by umsrfc.library/AllocUMSRFCData()
  131.   */
  132.  UMSAccount  urd_Account;    /* UMS user account             READ ONLY!!! */
  133.  const char *urd_DomainName; /* Domain name of the system    READ ONLY!!! */
  134.  const char *urd_PathName;   /* System name for Path: lines  READ ONLY!!! */
  135.  ULONG       urd_Flags;      /* Global flags                 (see above)  */
  136.  
  137.  /*
  138.   * These fields will be filled by umsrfc.library/GetUMSMessage()
  139.   */
  140.  UMSMsgTextFields     urd_MsgFields; /* UMS message fields   READ ONLY!!! */
  141.  struct UMSRFCMsgData urd_MsgData;   /* Additional msg data  READ ONLY!!! */
  142.                                      /* RFC addr of sender   READ ONLY!!! */
  143.  UBYTE                urd_FromAddress[UMSRFC_ADDRLEN];
  144.  
  145.  /*
  146.   * These fields will be filled by umsrfc.library/ReadRFCMessage()
  147.   *
  148.   * All tag values are READ ONLY except for the last entry, which will be
  149.   * initialized to TAG_DONE. The caller may modify this value to TAG_MORE
  150.   * in order to add a pointer to additional tag values.
  151.   */
  152.  struct TagItem urd_MailTags[UMSRFC_MAILTAGS]; /* Tag array for mail msgs */
  153.  struct TagItem urd_NewsTags[UMSRFC_NEWSTAGS]; /* Tag array for news msgs */
  154. };
  155.  
  156. #ifdef _DCC
  157. #define __ASM
  158. #define __REG_ARG(x) __ ## x
  159. #elif __SASC
  160. #define __ASM __asm
  161. #define __REG_ARG(c) register x
  162. #else
  163. #error Register argument macros not defined!
  164. #endif
  165.  
  166. /*
  167.  * Function pointer prototype for output function
  168.  *
  169.  * This functions will be used by umsrfc.library/WriteRFCMessage()
  170.  */
  171. typedef __ASM void (*UMSRFCOutputFunction)(__REG_ARG(A0) void *outputdata,
  172.                                            __REG_ARG(D0) char  character);
  173.  
  174. #endif
  175.